var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2EventsMgr = require("EventsMgr");
var $2DataManager = require("DataManager");
var $2FlbDateTimeUtil = require("FlbDateTimeUtil");
var $2UIManager = require("UIManager");
var $2AudioManager = require("AudioManager");
var $2KDefine = require("KDefine");
var $2MenuUI = require("MenuUI");
var $2ADManager = require("ADManager");
var $2pvzChannel = require("pvzChannel");
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_JjdfEnd = /* */function (_cc$Component34) {
  babel_inherits(f, _cc$Component34);
  var _super38 = babel_createSuper(f);
  function f() {
    var _this84;
    babel_classCallCheck(this, f);
    _this84 = _super38.apply(this, arguments);
    _this84.j003 = null;
    _this84.j004 = null;
    _this84.tips2 = null;
    _this84.tips3 = null;
    return _this84;
  }
  babel_createClass(f, [{
    key: "onLoad",
    value: function onLoad() {
      this.j003 = cc.find("j003", this.node);
      this.j004 = cc.find("j004", this.node);
      this.tips2 = cc.find("tips2", this.node);
      this.tips3 = cc.find("tips3", this.node);
      $2ADManager.default.instance.recorderStop();
      if ("wx2" === $2pvzChannel.pvzChannel.instance().channel && $2pvzChannel.pvzChannel.instance().getCtrl("p10")) {
        this.j003.active = false;
      } else {
        this.j003.active = true;
        this.j003.on(cc.Node.EventType.TOUCH_START, this.on_menu, this);
      }
      this.j004.on(cc.Node.EventType.TOUCH_START, this.on_restart, this);
      var e = $2DataManager.default.instance.offset_time;
      this.tips2.getComponent(cc.Label).string = $2FlbDateTimeUtil.FlbDateTimeUtil.sjformate(e);
      var t = 10 * Math.floor(e / 10);
      t > 100 && (t = 100);
      this.tips3.getComponent(cc.Label).string = t + "%";
    }
  }, {
    key: "on_menu",
    value: function on_menu() {
      this.node.active = false;
      $2UIManager.default.instance.closeUI("RecordUI");
      $2UIManager.default.instance.uiList.MenuUI.getComponent($2MenuUI.default).showNode();
      this.node.parent.active = false;
      $2AudioManager.default.instance.playMusic($2KDefine.AudioName.MenuBgm, true);
    }
  }, {
    key: "on_restart",
    value: function on_restart() {
      this.node.active = false;
      $2EventsMgr.EventsManager.emit("game_over");
    }
  }]);
  return f;
}(cc.Component);
def_JjdfEnd = cc__decorate([ccp_ccclass], def_JjdfEnd);
exports.default = def_JjdfEnd;